<%@ page contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
<link type="text/css" href="css/joinok.css" rel="stylesheet" />
</head>
<body>
	<form class="form">
		<div id="di" class="div1">
			<br />
			<label>아이디 :  </label>
			<input type="text" name="idt" id="idt"/><br /><br />
			<label>비밀번호 : </label>
			<input type="password" name="pwd" id="pwd"/><br /><br />
			<label>비밀번호 확인 : </label>
			<input type="password" name="rpwd" id="rpwd" onblur="checkpwd();"/><span id="result"/><br /><br />
			<label>이름 : </label>
			<input type="text" name="namet" id="namet"/><br /><br />
			<label>좋아하는 장르 : </label>
			<select name="genre" style="width: 131px;">
				<option selected="selected">액션</option>
				<option>로맨스</option>
				<option>공포/스릴러</option>
				<option>전쟁</option>
				<option>SF</option>
			</select><br /><br />
			우편번호 : <input type="text" id="zip1" size="4" />
			 - <input type="text" id="zip2" size="4" />
 			<button type="button" onclick="showZipcode()">우편번호 찾기</button><br /><br />
 			주소 : <input type="text" id="addr" size="35" /><br /><br />
 			나머지 주소 : <input type="text" id="etcaddr" size="45"/><br /><br />
			휴대폰 번호 : <input type="text" name="hpt" id="hpt"/><br /><br />
			이메일 : <input type="text" name="emt" id="emt"/><br /><br />
			<button type="submit" value="회원가입">회원가입</button>
		</div>
		<div id="button" class="div2">
			<br />
			<button type="button" >아이디 중복확인</button>
		</div>
	</form>
</body>
</html>
<script type="text/javascript" src="../js/jquery1.10.2.min.js"></script>
<script>
	function checkpwd(){
		var pwd = document.getElementById("pwd").value;
		var rpwd = document.getElementById("rpwd").value;
		var re = "다시 비밀번호를 입력해주세요";
		
		var req = null;
		if(window.XMLHttpRequest)
			req = new XMLHttpRequest();
		else if(window.ActiveXObject)
			req = new ActiveXObject("Microsoft.XMLHTTP");
		req.onreadystatechange = function(){
			if(req.readyState == 4){
				if(req.status == 200)
					result.innerHTML = req.responseText;
				else
					result.innerHTML = req.responseText;
			}else{}
		}
		req.open('GET', './checkpwd.jsp?pwd='+pwd+
				'./checkpwd.jsp?rpwd='+rpwd, true);
		req.send(null);
	}
</script>